package cn.cjxy.web.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "loginSuccess", urlPatterns = "/loginSuccess")
public class LoginSuccess extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=utf-8");

        String name = (String) request.getAttribute("name");
        String password = (String) request.getAttribute("password");

        response.getWriter().print(String.format("用户%s登录成功", name));
    }
}
